package com.spa.infrastructure.enums.dict.massagist;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.spa.infrastructure.annotation.SysDictEnumAnnotation;
import com.spa.infrastructure.enums.dict.IBaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;


@Getter
@AllArgsConstructor
@SysDictEnumAnnotation(key = "massagistStatus", desc = "技师状态")
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum MassagistStatusEnum implements IBaseEnum {

    $10(10, "休息中",1,0),
    $20(20, "可预约",2,0),
    $30(30, "服务中",3,0);

    private Integer code;
    private String desc;
    //排序
    private Integer sort;
    //状态  0 启用  1 不启用
    private Integer status;

    public static MassagistStatusEnum byCode(int code) {
        for (MassagistStatusEnum value : values()) {
            if (value.code == code) return value;
        }
        return null;
    }
}
